<form autocomplete="off" class="layui-form layui-box modal-form-box" action="{:request()->url()}" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">所属分类：</label>
        <div class="layui-input-block">
            <select name='pid' class='layui-select full-width block'>
                <!--{foreach cates as $cate}-->
                <!--{eq name='cate.id' value='$vo.pid|default=0'}-->
                <option selected {if isset($cate.status)&&$cate.status==2}disabled{/if} value='{$cate.id}'>{$cate.spl|raw}{$cate.name|default=''}</option>
                <!--{else}-->
                <option value='{$cate.id}' {if isset($cate.status)&&$cate.status==2}disabled{/if}>{$cate.spl|raw}{$cate.name}</option>
                <!--{/eq}-->
                <!--{/foreach}-->
            </select>
            <p class="help-block">手机端只显示顶级分类，PC端显示全部</p>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">名称（标题）：</label>
        <div class="layui-input-block">
            <input autofocus name="name" value='{$vo.name|default=""}' required title="请输入" placeholder="请输入" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item hide">
        <label class="layui-form-label">选择筛选条件：</label>
        <div class="layui-input-block">
            <select name="filter_id" xm-select="{:time()}">
                {foreach $filter as $f}
                <option value="{$f.id}" {if $f.status=='2'}disabled="disabled"{/if} {if isset($vo['filter_id']) && in_array($f.id,explode(',',$vo['filter_id']))} selected="selected"{/if}>{$f.name} </option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">分类描述：</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入分类描述" title="请输入分类描述" class="layui-textarea" name="desc">{$vo.desc|default=""}</textarea>
        </div>
    </div>
    {if isset($vo['id'])}
    <input type='hidden' value='{$vo.id}' name='id'/>
    {else}
    <input type="hidden" value="{:date('Y-m-d H:i:s')}" name="create_at">
    {/if}

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
<script>
    var formSelects = layui.formSelects;
    window.formSelects.render('{:time()}');
</script>
